<?php 
namespace app\seller\validate;
use think\validate;
class DiscountValidate extends Validate{
    //验证规则
    protected $rule = array(
		'discount_name' => 'max:100',
		'shop_id'=>'number',
		'goods_id'=>'number',
    	);
    //验证失败提示信息
    protected $message = array(
		'discount_name.max'=>'促销名称的值不能超过100个字符',
		'shop_id.number'=>'店铺ID的值必须是一个整数',
		'goods_id.number'=>'商品id的值必须是一个整数',
);
    //验证场景
    protected $scene = array(
		'add'=>array('discount_name','shop_id','goods_id','rate'),
		'edit'=>array('discount_id','discount_name','shop_id','goods_id','rate'),
	);

}